﻿<%@ Page Language="VB" %>

<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace='Microsoft.Reporting.WebForms' %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Try
            Dim parameters = New List(Of ReportParameter)()

            Dim pLevel = New ReportParameter("str_master_department_level", Request.QueryString("str_master_department_level"))
            pLevel.Name = "str_master_department_level"
            parameters.Add(pLevel)
        
            'Dim pCode = New ReportParameter("str_department_code", Request.QueryString("str_department_code"))
            'pCode.Name = "str_department_code"
            'parameters.Add(pCode)

            'Dim pStatus = New ReportParameter("str_department_status", Request.QueryString("str_department_status"))
            'pStatus.Name = "str_department_status"
            'parameters.Add(pStatus)

            ReportViewer1.LocalReport.SetParameters(parameters)
        Catch ex As Exception
            GenericHelper.ShowAlert(Me, ex)
        End Try

    End Sub
    
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <%--<a href="report_stp_department.aspx">report_stp_department.aspx</a>--%>
    <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt"
        Height="500px" Width="100%">
        <LocalReport ReportPath="Reports\report_stp_department.rdlc">
            <DataSources>
                <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="stp_department_USP_List_stp_department" />
            </DataSources>
        </LocalReport>
    </rsweb:ReportViewer>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="GetDataTable1" TypeName="StpDepartment">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="0" Name="department_code" QueryStringField="department_code"
                Type="String" />
            <asp:QueryStringParameter DefaultValue="0" Name="master_department_code" QueryStringField="master_department_code"
                Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    </form>
</body>
</html>
